﻿using System;

class Program
{
    static void Main()
    {
        int[] array = { 1, 2, 3, 4, 5 };//示例数组
        int max = array[0];
        int min = array[0];
        int sum = 0;

        foreach (int num in array)
        {
            if (num > max)
            {
                max = num;
            }
            if (num < min)
            {
                min = num;
            }
            sum += num;
        }

        double average = (double)sum / array.Length;

        Console.WriteLine($"最大值: {max}");
        Console.WriteLine($"最小值: {min}");
        Console.WriteLine($"平均值: {average}");
        Console.WriteLine($"总和: {sum}");
    }
}